 
 <?php
use App\Http\Tools as Tools;

?>
<!--    继承layouts/thr_master.php模板  -->
@extends('layouts.thr_master')


<!-- 重写内容  -->
@section('content')
<link rel="stylesheet" type="text/css" href="/css/libs/font-awesome.css"/>
<link rel="stylesheet" type="text/css" href="/css/libs/nanoscroller.css"/>
 
<link rel="stylesheet" type="text/css" href="/css/compiled/theme_styles.css"/>
 
<link rel="stylesheet" type="text/css" href="/css/libs/dataTables.fixedHeader.css">
<link rel="stylesheet" type="text/css" href="/css/libs/dataTables.tableTools.css">
 
<link type="image/x-icon" href="favicon.png" rel="shortcut icon"/>
 

<!--[if lt IE 9]>
		<script src="/js/html5shiv.js"></script>
		<script src="/js/respond.min.js"></script>
	<![endif]-->
<script type="text/javascript">
/* <![CDATA[ */
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-49262924-2']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

(function(b){(function(a){"__CF"in b&&"DJS"in b.__CF?b.__CF.DJS.push(a):"addEventListener"in b?b.addEventListener("load",a,!1):b.attachEvent("onload",a)})(function(){"FB"in b&&"Event"in FB&&"subscribe"in FB.Event&&(FB.Event.subscribe("edge.create",function(a){_gaq.push(["_trackSocial","facebook","like",a])}),FB.Event.subscribe("edge.remove",function(a){_gaq.push(["_trackSocial","facebook","unlike",a])}),FB.Event.subscribe("message.send",function(a){_gaq.push(["_trackSocial","facebook","send",a])}));"twttr"in b&&"events"in twttr&&"bind"in twttr.events&&twttr.events.bind("tweet",function(a){if(a){var b;if(a.target&&a.target.nodeName=="IFRAME")a:{if(a=a.target.src){a=a.split("#")[0].match(/[^?=&]+=([^&]*)?/g);b=0;for(var c;c=a[b];++b)if(c.indexOf("url")===0){b=unescape(c.split("=")[1]);break a}}b=void 0}_gaq.push(["_trackSocial","twitter","tweet",b])}})})})(window);
/* ]]> */
</script>
<div class="row">
<div class="col-lg-12">
<div class="main-box clearfix">
<header class="main-box-header clearfix">
<h1>项目列表</h1>
</header>
<div class="main-box-body clearfix">
<div class="table-responsive">
<table id="table-example" class="table table-hover">
<thead>
<tr>
<th>序号</th>
			<th>项目</th>	
			<th>项目状况</th>
			<th>操作</th>

			<th>开题报告</th>
			<th>中期检查表</th>
			<th>结题报告</th>
			<th>成果跟踪</th>
			<th>展板提交</th>
			<th>经费预算</th>

			<th>修改</th>
			<th>删除</th>
</tr>
</thead>
<tbody>
    	@if(!empty($user))
			@for($i=0;$i< count($user->projects);$i++)
				<tr>
					<td>{{$i+1}}</td>
					<td>
						<a href="/thr_pro_detail/{{$user->projects[$i]->pid}}">{{$user->projects[$i]->pname }}</a>
					</td>
					
					



					@if($user->projects[$i]->type==0)
						<td>
							{{Tools::getState(0)}}
						</td>
						<td>
							<a href="#" >
								<span class="label label-default" type="submit" disabled name="link" class="label label-success">无操作</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==1)
						<td>
							{{Tools::getState(1)}}
						</td>
						<td>
							<a href="/thr/confirm/{{$user->projects[$i]->pid}}">
								<span class="label label-success" type="submit" name="link">选择组员</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==2)
						<td>
							{{Tools::getState(2)}}
						</td>
						<td>
							<a href="#">
								<span class="label label-default" type="submit" disabled name="link">无操作</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==3)
						<td>
							{{Tools::getState(3)}}
						</td>
						<td>
							<a href="/thr/confirm_start/{{$user->projects[$i]->pid}}">
								<span class="label label-success" type="submit" name="link">开题审核</button>
							</a>
						</td>
					@elseif($user->projects[$i]->type==4)
					<td>
						{{Tools::getState(4)}}
					</td>
					<td>
						<a href="#">
							<span class="label label-default" type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==5)
					<td>
						{{Tools::getState(5)}}
					</td>
					<td>
						<a href="/thr/confirm_mid/{{$user->projects[$i]->pid}}">
							<span class="label label-success" type="submit" name="link">中期审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==6)
					<td>
						{{Tools::getState(6)}}
					</td>
					<td>
						<a href="#">
							<span class="label label-default" type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==7)
					<td>
						{{Tools::getState(7)}}
					</td>
					<td>
						<a href="/thr/confirm_end/{{$user->projects[$i]->pid}}">
							<span type="submit" name="link" class="label label-success">结题审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==8)
					<td>
						{{Tools::getState(8)}}
					</td>
					<td>
						<a href="#">
							<span class="label label-default" type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==9)
					<td>
						{{Tools::getState(9)}}
					</td>
					<td>
						<a href="/thr/confirm_result/{{$user->projects[$i]->pid}}">
							<span class="label label-success" type="submit" name="link">成果审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==10)
					<td>
						{{Tools::getState(10)}}
					</td>
					<td>
						<a href="#">
							<span class="label label-default" type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==11)
					<td>
						{{Tools::getState(11)}}
					</td>
					<td>
						<a href="/thr/confirm_panels/{{$user->projects[$i]->pid}}">
							<span class="label label-success" type="submit" name="link">展板审核</button>
						</a>
					</td>
					@elseif($user->projects[$i]->type==12)
					<td>
						{{Tools::getState(12)}}
					</td>
					<td>
						<a href="/thr/confirm_panels/{{$user->projects[$i]->pid}}">
							<span class="label label-default" type="submit" disabled name="link">无操作</button>
						</a>
					</td>
					@endif


					@if($user->projects[$i]->type>3)
					<td><a href="/thr/confirm_start/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif

					@if($user->projects[$i]->type>5)
					<td><a href="/thr/confirm_mid/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif
					
					@if($user->projects[$i]->type>7)
					<td><a href="/thr/confirm_end/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif
					
					@if($user->projects[$i]->type>9)
					<td><a href="/thr/confirm_result/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif
					
					@if($user->projects[$i]->type>11)
					<td><a href="/thr/confirm_panels/{{$user->projects[$i]->pid}}">查看</a></td>
					@else
					<td>无</td>
					@endif

					@if($user->projects[$i]->type < 12)
					<td>
						<a href="/thr/modify_fees/{{$user->projects[$i]->pid}}">
                        <span class="fa-stack">
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-search-plus fa-stack-1x fa-inverse"></i>
</span>
							<!--<span class="fa fa-pencil fa-stack-1x fa-inverse" type="submit"  name="link">修改经费</button>-->
						</a>
					</td>
					@else
					<td>
						<a href="/thr/modify_fees/{{$user->projects[$i]->pid}}">
                        <span class="fa-stack">
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-search-plus fa-stack-1x fa-inverse"></i>
</span>
							<!--<span class="fa fa-pencil fa-stack-1x fa-inverse" type="submit"  name="link">修改经费</button>-->
						</a>
					</td>
					@endif





					@if($user->projects[$i]->type <=1 )
					<td>
						<a href="/thr/modify_pro/{{$user->projects[$i]->pid}}">
							<span class="label label-warning" type="submit"  name="link">修改</span>
						</a>
					</td>

					@else

					<td>
						<a href="#">
							<span class="label label-default" disabled type="submit" name="link">修改</span>
						</a>
					</td>
					@endif



					@if($user->projects[$i]->type ==0 )
					<td>
						<a href="/thr/delete_pro/{{$user->projects[$i]->pid}}">
                        <span class="fa-stack" type="submit">
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-trash-o fa-stack-1x fa-inverse"></i>
</span>
							<!--<button type="submit"  name="link">删除</button>-->
						</a>
					</td>
					@else
					<td>
						<a href="#">
                            <span class="fa-stack"  type="submit" disabled >
<i class="fa fa-square fa-stack-2x"></i>
<i class="fa fa-trash-o fa-stack-1x fa-inverse"></i>
</span>
							<!--<button type="submit" disabled name="link">删除</button>-->
						</a>
					</td>
					@endif




				</tr>

			@endfor
		@else
			<h3 align="center">你还没有发布任何项目</h3>
		@endif

</tbody>
</table>
</div>
</div>
</div>
</div>
<script src="/js/demo-skin-changer.js"></script>  
<script src="/js/jquery.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/jquery.nanoscroller.min.js"></script>
<script src="/js/demo.js"></script>  
 
<script src="/js/jquery.dataTables.js"></script>
<script src="/js/dataTables.fixedHeader.js"></script>
<script src="/js/dataTables.tableTools.js"></script>
<script src="/js/jquery.dataTables.bootstrap.js"></script>
 
<script src="/js/scripts.js"></script>
<script src="/js/pace.min.js"></script>
 
<script>
	$(document).ready(function() {
		var table = $('#table-example').dataTable({
			'info': false,
			'sDom': 'lTfr<"clearfix">tip',
			'oTableTools': {
	            'aButtons': [
	                {
	                    'sExtends':    'collection',
	                    'sButtonText': '<i class="fa fa-cloud-download"></i>&nbsp;&nbsp;&nbsp;<i class="fa fa-caret-down"></i>',
	                    'aButtons':    [ 'csv', 'xls', 'pdf', 'copy', 'print' ]
	                }
	            ]
	        }
		});
		
	    //var tt = new $.fn.dataTable.TableTools( table );
		//$( tt.fnContainer() ).insertBefore('div.dataTables_wrapper');
		
		var tableFixed = $('#table-example-fixed').dataTable({
			'info': false,
			'pageLength': 50
		});
		
		new $.fn.dataTable.FixedHeader( tableFixed );
	});
	</script>
    <link rel="stylesheet" type="text/css" href="/css/bootstrap/bootstrap.min.css"/>
 
<script src="/js/demo-rtl.js"></script>
	

@endsection

<!--<tr>
<td>Tiger Nixon</td>
<td>System Architect</td>
<td>Edinburgh</td>
<td>61</td>
<td>2011/04/25</td>
<td>$320,800</td>
</tr>
<tr>
<td>Garrett Winters</td>
<td>Accountant</td>
<td>Tokyo</td>
<td>63</td>
<td>2011/07/25</td>
<td>$170,750</td>
</tr>-->
